6.2 For each of the following program segments, hypothesize if the segment would generate a compile-time error, a run-time exception, or neither. Then test your hypotheses with a main method that includes each segment. a. ArrayList myList.add ("yes"); myList.add (7); b. ArrayList original.add (7); c. ArrayList double x = 7; original.add (x); d. ArrayList newList.add ("yes"); Integer answer = (Integer)newList.get (0); | |
| View Solution | |
| << Back | Next >> |